PROJECT(libxpm)


FIND_PACKAGE(Qt4 REQUIRED)
#find xerces package
INCLUDE(${QT_USE_FILE})

#add the files to our groups and app
SOURCE_GROUP("mapedit" ./mapedit/*)
#seems to be a bug in cmake, can't put these in analysis\\standard folder :(
#upper detail

#QT4_WRAP_CPP
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})

QT4_WRAP_CPP(XpmTextEdit_MOCS ./XpmTextEdit.h)
QT4_WRAP_CPP(XpmCompleter_MOCS ./XpmCompleter.h)
#map edit
QT4_WRAP_CPP(mapeditor_MOCS ./mapedit/mapeditor.h)
QT4_WRAP_CPP(addmap_MOCS ./mapedit/addmap.h)
QT4_WRAP_CPP(removemap_MOCS ./mapedit/removemap.h)
QT4_WRAP_CPP(XpmDocModel_MOCS ./mapedit/XpmDocModel.h)
QT4_WRAP_CPP(XpmLineEdit_MOCS ./mapedit/XpmLineEdit.h)
QT4_ADD_RESOURCES(mapeditor_SRCS ./mapedit/mapeditor.qrc)
QT4_ADD_RESOURCES(textedit_SRCS ./textedit.qrc)
QT4_WRAP_UI(mapeditor_UIS ./mapedit/mapeditor.ui)
QT4_WRAP_UI(mapeditor_UIS ./mapedit/addmap.ui)
QT4_WRAP_UI(mapeditor_UIS ./mapedit/removemap.ui)
#QT4_WARP_UI

SET(libxpm_Files
	#for example 
	#./control/ControlSynset.cpp	
#	./textedit/main.cc	
#	./textedit/xpmschema.cc
#	./textedit/xpm.cc
	./mapedit/mapeditor.cc
	./mapedit/addmap.cc
	./mapedit/removemap.cc
	./mapedit/XpmDocModel.cc
	./mapedit/TreeItem.cc
	./mapedit/BlockTreeItem.cc
	./mapedit/TermTreeItem.cc
	./mapedit/XpmLineEdit.cc
	./XpmTextEdit.cc
	./XpmCompleter.cc
	${mapeditor_MOCS}
	${XpmTextEdit_MOCS}
	${XpmCompleter_MOCS}
	${XpmDocModel_MOCS}
	${addmap_MOCS}
	${removemap_MOCS}
	${XpmLineEdit_MOCS}
	${mapeditor_UIS}
	${addmap_UIS}
	${removemap_UIS}
	${mapeditor_SRCS}	
	${textedit_SRCS}
)


#find our headers
file(GLOB_RECURSE HEADERS ${libxpm_SOURCE_DIR}/*.h)



#create the libraries
SET(libconex ../libconex)
SET(libsfa ../libsfa)
SET(libjson ../../libs/libjson-master)

INCLUDE_DIRECTORIES( ${libxpm_SOURCE_DIR} 
                     ${libjson}
					 ${libsfa}
					 ${libconex}
					 )			 


add_library(libxpm
	           ${libxpm_Files} 
	           ${HEADERS})